import java.awt.Graphics2D;
import java.awt.event.KeyEvent;
import java.awt.event.MouseEvent;

/* Notes:
 * 	-Level will be a Phase. (That'll make it easier to transition between levels.)
 * 	-Shop will also be a Phase. (GamePhase.getCurrent() will return either a Shop or a Level.)
 * 	-Will have a method "nextLevel()" in some other place...
 * 	-In Level, have nexts and previouses as levels, when a method takes place, such as "endLevel()", make a temp Phase
 * 		Shop, set temp's next to the current Level's next and then set the current Phase in GamePhase to that Shop.
 * 		^Don't need a backwards reference in Phases, possibly.
 * 
 */

public class GamePhase extends Phase {

	private Level currentLevel;
	private Player p;
	
	private int totalWaves;
	private int wavesToDifficultyModifier;
	//private int levelInt;
	private int baseDifficulty;
	private int difficultySum;
	
	private int[] cheats; // able to have multiple on at the same time?
	
	private boolean isShopping;
	private int money;
	
	//private int scoreRatioNumerator; /// ???
	//private int scoreRatioDenominator; // ???
	
	private int baseScore; // pre-modifiers
	private int totalScore;// post-modifiers
	
	public GamePhase(GameInterface cgi){
		super(cgi);
		p = new Player();
		p.setWeaponArray(new Weapon[]{new Weapon(p, new Projectile[]{},-1,5000)});
		currentLevel = new LevelBeta001(getGameInterface(),p);
		p.setContainer(currentLevel);
		isShopping = false;
	}
	
	public void update(long l){
		currentLevel.update(l);
	}
	public void display(Graphics2D g){
		currentLevel.display(g);
		//System.out.println("getting here too");
	}
	
	public void mouseInput(MouseEvent me){
		if(!isShopping)
			currentLevel.mouseInput(me);
	}
	public void keyInput(KeyEvent ke){
		if(!isShopping)
			currentLevel.keyInput(ke);
	}
	
	//public int getLevelInt(){return levelInt;}
	public int getTotalWaves(){return totalWaves;}
	public int getWavesToDifficultyModifier(){return wavesToDifficultyModifier;}
	public int getBaseDifficulty(){return baseDifficulty;}
	public int getDifficultySum(){return difficultySum;}
	public int[] getCheats(){return cheats;}
	//public boolean getIsShopping(){return isShopping;}
	public int getMoney(){return money;}
	public int getBaseScore(){return baseScore;}
	public int getTotalScore(){return totalScore;}
	
	//public void setLevelInt(int sli){levelInt = sli;}
	public void setTotalWaves(int stw){totalWaves = stw;}
	public void setWavesToDifficultyModifier(int swtdm){wavesToDifficultyModifier = swtdm;}
	public void setBaseDifficulty(int sbd){baseDifficulty = sbd;}
	public void setDifficultySum(int sds){difficultySum = sds;}
	public void setCheats(int[] sc){cheats = sc;}
	//public void setIsShopping(boolean sis){isShopping = sis;} // send "GamePhase" as a GamePhase to Level's and Shop's
	public void setMoney(int sm){money = sm;}
	public void setBaseScore(int sbs){baseScore = sbs;}
	public void setTotalScore(int sts){totalScore = sts;}
}
